package com.learner.ucenter.service.impl;

import com.learner.pojo.user.FeedBack;
import com.learner.pojo.user.vo.FeedBackResultVo;
import com.learner.ucenter.repository.FeedBackDao;
import com.learner.ucenter.service.FeedBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author linweibing
 * @date 2023-03-28 19:38
 * @description: TODO
 */
@Service
public class FeedBackServiceImpl implements FeedBackService {

    @Autowired
    FeedBackDao feedBackDao;

    @Autowired
    MongoTemplate mongoTemplate;

    @Override
    public void addFeedBack(FeedBack feedBack) {
        feedBackDao.save(feedBack);
    }


    @Override
    public List<FeedBackResultVo> getFeedbackList() {
        return mongoTemplate.findAll(FeedBackResultVo.class, "feedbacks");
    }


}
